#ifndef PRIVATECHATMANAGER_H
#define PRIVATECHATMANAGER_H

#include <QObject>
#include <vector>
#include "privatechatwindow.h"

class PrivateChatManager : public QObject
{
    Q_OBJECT

public:
    PrivateChatManager(QObject *parent = 0);
    ~PrivateChatManager();

    void newPrivateChat(const QString &friend_loginName);
    PrivateChatWindow* getPrivateChat(const QString &friend_loginName);
    int getPrivateChatIndex(const QString &friend_loginName);
    void deletePrivateChat(const QString &friend_loginName);
    
private:
    std::vector<PrivateChatWindow *> privateChatWindows;

signals:
    void sendMessageToFriend(const QString &friend_loginName, const QString &message);

private slots:
    void on_sendMessageToFriend(const QString &friend_loginName, const QString &message);
    void on_newPrivateMessage(const QString &sender, const QString &message, const QString &to);
    void on_privateChatWindowClose(const QString &friend_loginName);
};

#endif // PRIVATECHATMANAGER_H
